import request from '@/config/axios'

export interface ControlVO {
  id: number
  name: string
  path: string
}

// 查询对照组列表
export const getControlList = async () => {
  return await request.get({ url: `/sca/control/list` })
}

// 查询对照组列表
export const getControlPage = async (params) => {
  return await request.get({ url: `/sca/control/page`, params })
}

// 查询对照组详情
export const getControl = async (id: number) => {
  return await request.get({ url: `/sca/control/get?id=` + id })
}

// 新增对照组
export const createControl = async (data: ControlVO) => {
  return await request.post({ url: `/sca/control/create`, data })
}

// 修改对照组
export const updateControl = async (data: ControlVO) => {
  return await request.put({ url: `/sca/control/update`, data })
}

// 删除对照组
export const deleteControl = async (id: number) => {
  return await request.delete({ url: `/sca/control/delete?id=` + id })
}

// 导出对照组 Excel
export const exportControl = async (params) => {
  return await request.download({ url: `/sca/control/export-excel`, params })
}
